<script setup>
import { ref } from 'vue'
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
function goBack() {
    router.back()
}
const deviceClassify = 3
const deviceClassId = '3001'
const deviceId = route.query.id
import deviceForm from '@/components/fireControl/deviceForm.vue'
const deviceFormRef = ref()
function submitAction() {
    deviceFormRef.value.submitAction()
}
function onSubmitSuccess() {
    goBack()
}
</script>
<template>
    <el-page-header @back="goBack">
        <template #content>
            <span>新增道闸设备</span>
        </template>
    </el-page-header>
    <div class="white-box d-flex-1 mt-10">
        <el-row :gutter="50">
            <el-col :span="16">
                <deviceForm
                    ref="deviceFormRef"
                    :deviceClassify="deviceClassify"
                    :deviceClassId="deviceClassId"
                    :deviceId="deviceId"
                    @success="onSubmitSuccess"
                ></deviceForm>
                <el-button
                    type="primary"
                    @click="submitAction"
                    style="margin-left: 120px"
                >
                    保存
                </el-button>
            </el-col>
            <el-col :span="8" class="article"> </el-col>
        </el-row>
    </div>
</template>
<style lang="scss" scoped>
.article {
    line-height: 1.8;
    color: #666;
}
</style>
